#ifndef SDelegate2_H
#define SDelegate2_H

#include "Global_Signal.h"
#include "abstractDelegate.h"

template <class T,class U>
class sDelegate2 : public AbstractDelegate
{
    public :

    int (*pDelegate)(T,U);            /*!< Prototype du pointeur de la fonction membre à exécuter  */

    T arg1;
    U arg2;

    sDelegate2(int (*apDelegate)(T,U),T aArg1, U aArg2);

    virtual void Run();

    template<class T>
     virtual  void Run(T arg)=0;

    template<class T, class U>
     virtual  void Run(T arg, U arg2)=0;

    template<class T, class U, class W>
     virtual  void Run(T arg, U arg2, W arg3)=0;
};


template <class T, class U>
sDelegate2<T,U>::sDelegate2(int (*apDelegate)(T,U),T aArg1, U aArg2)
{
        pDelegate=apDelegate;
        arg1=aArg1;
        arg2=aArg2;
}


template <class T, class U>
void sDelegate2<T,U>::Run()
{
    (*pDelegate)(arg1, arg2);
}
#endif // SDelegate2_H
